<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!doctype html>
<html>
<meta http-equiv="Access-Control-Allow-Origin" content="*">
<jsp:include page="../common/import.jsp" flush="true"></jsp:include>
<script src="${base}/agent/public/js/ajaxupload.js" type="text/javascript"></script>
<script src="${base}/agent/public/js/map.js"></script>
<!-- zTree -->
<%-- <script src="${base}/agent/public/js/api.js"></script>
<script src="${base}/agent/public/js/jquery-1.4.4.min.js"></script>
<script src="${base}/agent/public/js/jquery.ztree.all-3.5.js"></script>

<link href="${base}/agent/public/css/zTreeStyle.css" rel="stylesheet" > --%>
<!--引用百度地图API-->
<%-- <style type="text/css">
   html,body{margin:0;padding:0;}
   .iw_poi_title {color:#CC5522;font-size:14px;font-weight:bold;overflow:hidden;padding-right:13px;white-space:nowrap}
   .iw_poi_content {font:12px arial,sans-serif;overflow:visible;padding-top:4px;white-space:-moz-pre-wrap;word-wrap:break-word}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=${baiduKey}"></script>
 --%>

<body>
<%-- <jsp:include page="../common/header.jsp" flush="true"></jsp:include> --%>
<div class="header">
	<div class="container clear">
    	<a class="fl" href="${base}/agent/merchant/merchantList.xhtml"><img src="http://www.wangpos.com/public/images/logo.png" alt="旺POS"></a>
        <a class="fl cfff f16" href="${base}/agent/merchant/merchantList.xhtml">&#8226;&nbsp;代理商平台</a>
        <a class="fr cfff" href="${base}/agent/user/logout.xhtml">退出</a>
        <a class="fr cfff mr10" href="${base}/agent/user/personalCenter.xhtml"><span class="iconfont mr5">&#xf012d;</span>${user.username}</a>
        <%-- 备用：显示用户等级
        <a class="fr cfff mr10" href="javascript:">${user.username}</a> 
        --%>
    </div>
</div>

<div class="p20 bgfff">
	<div class="container bgfff pb50">
	
	<ul class="clear tc f18 mt20 add-store-ul">
        	<li class="fl lihover">搜索门店</li>
            <li class="fl lihover">填写信息</li>
            <li class="fl">预览并提交</li>
        </ul>
	
    	<div class="p20">
        	<form id="dataForm" method="post" action="${base}/agent/store/preview.xhtml" onsubmit=" return preview();">
        	<input type="hidden" name="qualificationId" value="${qualificationId}">
        	<input type="hidden" name="baidUid" id="baidUid" value="${baidUid }">
        	<div class="clear">
            	<!-- <button class="fr bg1eb9ef cfff p5 b-radius w60"><span class="iconfont">&#xf0168;</span>&nbsp;编辑</button> -->
                <h2 class="bb lg30 h30 f18 c000 pb5">基本信息</h2>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">店铺名称：</div>
                <div class="fl">
                	<input class=" w750 p5 h20" type="text" value="${store.name}" name="name" id="shopName">
                    <p class="ca0">请输入店铺详细名称，例如：北京东方饺子馆</p>
                </div>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">店铺电话：</div>
                <div class="fl">
                	<input class=" w750 p5 h20" type="text" value="${store.tel}" name="tel" id="shopPhone">
                    <p class="ca0">请输入固定电话</p>
                </div>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">店铺地址：</div>
                <div class="fl">
                ${store.address.address_detail}
                	<select id="province" name="province" class="lg30 w112 h30 b">
                    	<option value="北京市">北京市</option>
						<option value="天津市">天津市</option>
						<option value="河北省">河北省</option>
						<option value="吉林省">吉林省</option>
						<option value="上海市">上海市</option>
						<option value="山西省">山西省</option>
						<option value="内蒙古">内蒙古</option>
						<option value="辽宁省">辽宁省</option>
						<option value="黑龙江省">黑龙江省</option>
						<option value="江苏省">江苏省</option>
						<option value="浙江省">浙江省</option>
						<option value="安徽省">安徽省</option>
						<option value="福建省">福建省</option>
						<option value="江西省">江西省</option>
						<option value="山东省">山东省</option>
						<option value="河南省">河南省</option>
						<option value="湖北省">湖北省</option>
						<option value="湖南省">湖南省</option>
						<option value="广东省">广东省</option>
						<option value="广西">广西</option>
						<option value="海南省">海南省</option>
						<option value="重庆市">重庆市</option>
						<option value="西藏">西藏</option>
						<option value="宁夏">宁夏</option>
						<option value="四川省">四川省</option>
						<option value="贵州省">贵州省</option>
						<option value="云南省">云南省</option>
						<option value="陕西省">陕西省</option>
						<option value="甘肃省">甘肃省</option>
						<option value="青海省">青海省</option>
						<option value="新疆">新疆</option>
                    </select>
                    <select id="city" name="city" class="lg30 w112 h30 b">
                    	<option value="北京市">北京市</option>
               			<option value="北京市辖县">北京市辖县</option> 
                    </select>
                    <select id="area" name="area" class="lg30 w112 h30 b">
                    	<option value="东城区">东城区</option>
                    	<option value="西城区">西城区</option>
                    	<option value="崇文区">崇文区</option>
                    	<option value="宣武区">宣武区</option>
                    	<option value="朝阳区">朝阳区</option>
                    	<option value="丰台区">丰台区</option>
                    	<option value="石景山区">石景山区</option>
                    	<option value="海淀区">海淀区</option>
                    	<option value="门头沟区">门头沟区</option>
                    	<option value="房山区">房山区</option>
                    	<option value="通州区">通州区</option>
                    	<option value="顺义区">顺义区</option>
                    	<option value="昌平区">昌平区</option>
                    	<option value="大兴区">大兴区</option>
                    	<option value="怀柔区">怀柔区</option>
                    	<option value="平谷区">平谷区</option>
                    </select>
                    <input class="w400 p5 h20" type="text" name="addressDetail" id="addressDetail" value="北辰西路8号院3号楼（B座）首层109单元">
                    <div class="mt20">
                     	<!-- user for geo2location -->
		                <input id="fcity" type="hidden" name="fcity" value=""/>
		                <input id="farea" type="hidden" name="farea" value=""/>
		                
		                <input type="hidden" id="uid" name="uid" value=""/>
		                <input type="hidden" id="id" name="id" value=""/>
		                <input type="hidden" id="from" name="from" value=""/>
		                
		               
		                <input id="LATITUDE" name="LATITUDE" type="hidden" v="required" m="店铺地址" value=""/>
		                <input id="LONGITUDE" name="LATITUDE" type="hidden" v="required" m="店铺地址" value=""/>
		                <input type="hidden" id="lng" name="lng" value=""/>
		                <input type="hidden" id="lat" name="lat" value=""/>
		                
		               <!--  <input type="hidden" class="input10" name="addressDetail" id="addressDetail" value=""> -->
		                
		                <!-- <input type="button" class="btn_1" value="在地图上标记" id="markBtn"> -->
                    	<button class="h30 p5 bg1eb9ef b-radius w150 cfff" id="markBtn">在地图上标记</button>
                    </div>
                     <!-- 地图组件 -->
            		<div class="map_main" id="mapdiv" style="width:700px !important;height:320px !important;margin-top: 20px;"></div>
            	
                    <!-- <div class="b h350 mt20"><img src="" width="760" height="350"></div> -->
                </div>
            </div>
            
            <h2 class="bb lg30 h30 f18 c000 pb5 mt20">联系人信息</h2>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">所属行业：</div>
            	
            	<input type="hidden" name="bizClassify1" id="bizClassify1" value="">
            	<input type="hidden" name="bizClassify2" id="bizClassify2" value="">
            	<input type="hidden" name="bizClassify3" id="bizClassify3" value="">
                <div class="fl">
                
	                <select id="level1" name="level1" class="lg30 w100 h30 b">
	            		<option value="1">餐饮食品</option>
	            		<option value="2">休闲娱乐</option>
	            		<option value="3">生活服务</option>
	            		<option value="4">丽人健身</option>
	            		<option value="5">其他</option>
	            	</select>
	            	<select id="level2" name="level2" class="lg30 w100 h30 b">
	            		<option value="1001">高档餐厅</option>
	            		<option value="1002">大众餐馆</option>
	            		<option value="1003">速食快餐</option>
	            		<option value="1004">自助餐厅</option>
	            		<option value="1005">私房会所</option>
	            		<option value="1006">小食饮品</option>
	            	</select>
	            	<select id="level3" name="level3" class="lg30 w100 h30 b">
	            		<option value="1001001">中餐</option>
	            		<option value="1001002">西餐</option>
	            		<option value="1001003">日韩菜</option>
	            		<option value="1001004">火锅烧烤</option>
	            		<option value="1001005">海鲜</option>
	            		<option value="1001006">风味特色菜</option>
	            		<option value="1001007">创意菜</option>
	            	</select>
            	
                </div>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">负责人姓名：</div>
                <div class="fl">
                	<input name="contactName" id="contactName" class=" w750 p5 h20" type="text" value="${store.contactUser.name}">
                    <p class="ca0">请输入门店负责人姓名</p>
                </div>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">负责人电话：</div>
                <div class="fl">
                	<input name="contactPhone" id="contactPhone" class=" w750 p5 h20" type="text" value="${store.contactUser.phone}">
                    <p class="ca0">请输入门店负责人姓名，用于通知门店最新审核状态</p>
                </div>
            </div>
            
            <h2 class="bb lg30 h30 f18 c000 pb5 mt20">资质认证</h2>
            <input type="hidden" id="busImg" name="busImg"/>
            <input type="hidden" id="shopImg" name="shopImg" />
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">营业执照：</div>
                <div class="fl w750">
                	<p class="lg20 mt5">要求：请上传营业执照副本清晰彩色原件扫描件或者数码拍摄照片，且确保最新年检章信息，文件大小不超过2M，文件格式为jpg、png或gif。</p>
                    <!-- <button class="b lg20 bga0 p5 w100 b-radius mt10">上传</button> -->
                    <input class="b lg20 bgfff p5 w100 b-radius mt10" type="button" value="上传" class="btn_6" id="busImgUpload" name="busImgUpload"/>
		            <div style="margin-top: 5px; margin-left:0px;display:none;" id="busImgDiv">
		                <img id="busImgSrc" width="100" height="100"/>
		            </div>
                </div>
            </div>
            
            <div class="lg30 clear mt10">
            	<div class="fl w200 tr c000 fb">门店照片：</div>
                <div class="fl w750">
                	<p class="lg20 mt5">要求：文件大小不超过2M，文件格式为jpg、png或gif，最多上传六张。</p>
                    <!-- <button class="b lg20 bga0 p5 w100 b-radius mt10">上传</button> -->
                    <input class="b lg20 bgfff p5 w100 b-radius mt10" type="button" value="上传" class="btn_6" id="shopImgUpload" name="shopImgUpload">
                <div style="margin-top: 5px; margin-left:0px;" id="shopImgDiv">
                    
                </div>
                <div class="tc pt30 cfff">
                    <button class="bga0 p5 w100 b-radius" onclick="backToSearchPage()">上一步</button>
                    <button class="bg1eb9ef p5 w100 b-radius ml30" >下一步</button>
                </div>
            </div>
            
        </div>
        </form>
    </div>
</div>
</div>

<jsp:include page="../common/footer.jsp" flush="true"></jsp:include>


<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
/* 
添加设备en
$('#add_en_btn').click(function(){
	$('#add_en').animate({height:150});
});

$('#add_en button').click(function(){
	$('#add_en').animate({height:0});
});
 */

$(function () {
	
	 $("#bizClassify1").val($("#level1").find("option:selected").text());
	 $("#bizClassify2").val($("#level2").find("option:selected").text());
	 $("#bizClassify3").val($("#level3").find("option:selected").text());
	 //行业信息三级联动（一级二级）
	 var edit_2 = '';
	 $("#level1").change(function(){
		 var html="";
		 $("#level2").html(html);
		 var id = $(this).val();
		 var childClassify = $(this).find("option:selected").text();
		 var url = "${base}/agent/bizClassify/childClassify.xhtml";
		 var data = {"id": id,"childClassify":childClassify,"level":1};
		 $.ajax({
			 url:url,
			 data:data,
			 type:"POST",
			 dataType:"json",
			 success:function (data){
				 $("#bizClassify1").val(childClassify);
				 //alert(data);
				 var lists = data.data;
				 var list = eval("("+lists+")");  
				 var html='';
				 for(var i=0;i<list.length;i++){
					 html += '<option value="' + list[i].id + '">' + list[i].name + '</option>';
				 }
				 $('#level2').html(html);
				 $('#level2').change();
			 },
			 error:function(data){
				 alert("服务端报错："+data.status);
			 }
		 });
	 });
	//行业信息三级联动（二级三级）
	 var edit_3 = '';
	 $("#level2").change(function(){
		 var html="";
		 $("#level3").html(html);
		 var id = $(this).val();
		 var childClassify = $(this).find("option:selected").text();
		 var url = "${base}/agent/bizClassify/childClassify.xhtml";
		 var data = {"id": id,"childClassify":childClassify,"level":2};
		 $.ajax({
			 url:url,
			 data:data,
			 type:"POST",
			 dataType:"json",
			 success:function (data){
				 $("#bizClassify2").val(childClassify);
				 //alert(data);
				 var lists = data.data;
				 if (lists&&lists.length>0) {
					 var list = eval("("+lists+")");  
					 var html='';
						
					 for(var i=0;i<list.length;i++){
						 html += '<option value="' + list[i].id + '">' + list[i].name + '</option>';
					 }
					 $('#level3').html(html);
					 $('#level3').change();
					 $("#bizClassify3").val(childClassify);
					 $('#level3').removeClass('none');
				}else{
					$('#level3').html(html);
					 $('#level3').change();
					$("#bizClassify3").val(childClassify);
					$('#level3').addClass('none');
				}
			 },
			 error:function(data){
				 alert("服务端报错："+data.status);
			 }
		 });
	 });
	//省市区三级联动（省--市）
	var edit_city = '';
	$("#province").change(function () {
		var html = "<option value=''>城市</option>";
		$("#city").html(html);
		
		var prov = "prov";
		var value = $(this).val();
		var url = "http://www.wangpos.com/service/address/refreshCity";
		var data = {"key": prov,"value":value,"url":url};
        $.ajax({
			url: "${base}/agent/agent/authorZone.xhtml",
			type: "POST",
			data: data,
			dataType: "JSON",
			success: function (data) {
				var ison = data +";";
				if (data.status == 0) {
					//hintError("数据错误");
					alert("数据错误");
					return;
				}
				var list = data.data;
				html = ''
				for (var i = 0; i < list.length; i++) {
					html += '<option value="' + list[i] + '">' + list[i] + '</option>';
				}
				// $("#prov").val(val);
				$("#city").html(html);
				if(edit_city != ''){
					$('#city').val(edit_city);
				}
				$('#city').change();
			},
			error: function (data) {
				alert('服务端报错' + data.status);
			}
		}); 
    });
});
//省市区三级联动（市--区）
	var edit_area = '';
	$("#city").change(function () {
	    var html = "<option value=''>城市</option>";
	    $("#area").html(html);
	   	var prov = $('#province').val();
	    var city = $(this).val();
	    var url = "http://www.wangpos.com/service/address/refreshArea";
	    var data = {"key1": "prov","value1":prov,"key2":"city","value2":city,"url":url};
		$.ajax({
	        url: "${base}/agent/store/authorZone.xhtml",
	        type: "POST",
	        data:data,
	        dataType: "json",
	        success: function (data) {
	        	var ison = data +";";
	        	
	        	if (data.status == 0) {
					//hintError("数据错误");
					alert("数据错误");
					return;
				}
				var list = data.data;
				html = ''
				for (var i = 0; i < list.length; i++) {
					html += '<option value="' + list[i] + '">' + list[i] + '</option>';
				}
				// $("#prov").val(val);
				$("#area").html(html);
				if(edit_area != ''){
					$('#area').val(edit_area);
				}
				$('#area').change();
	        	
	            
	        },
	        error: function (data) {
	            alert('服务端报错' + data.status);
	        }
		});
		});
		
	

	//百度地图：根据位置定位标注
 	$("#markBtn").click(function () {
		//var province = $("#province").val();
     	var city = $("#city").val();
     	var area = $("#area").val();
     	var detail = $("input[name='addressDetail']").val();
     	if (!province || !city || !area || !detail) {
         	alert('请输入店铺地址后再进行标记');
         	return;
     	}
     	$("#markBtn").val('标记中...');
     	$("#markBtn").prop({disabled: true});
     	$.ajax({
         	url: "${base}/agent/map/location2Geo.xhtml",
         	type: "POST",
         	data: {
				city: city,
				area: area,
				detail: detail
         	},
         	dataType: "json",
         	success: function (data) {
				alert(data.info);
				if (data.status == 0) {
					// 标注地图
					map.clearOverlays();
					//var locations = data.data.split(",");//lng+","+lat
					//定义一个中心点坐标
                 	var point = new BMap.Point(data.data.lng, data.data.lat);
                 	//设定地图的中心点和坐标并将地图显示在地图容器中
                 	map.centerAndZoom(point, 15);   
                 	//创建标注	
                 	var marker = new BMap.Marker(point);
                 	//跳动的动画
                 	marker.setAnimation(BMAP_ANIMATION_BOUNCE);
                 	//将标注添加到地图中
                 	map.addOverlay(marker);  
                 	map.setCenter(point);
					//记录一下经纬度
                	$("#lng").val(data.data.lng);
                 	$("#lat").val(data.data.lat);
             	} else {
                 	map.clearOverlays();
             	}
             	$("#markBtn").val('在地图上标记');
             	$("#markBtn").prop({disabled: false});
         	},
         	error: function (data) {
             	/* art.dialog('服务端报错' + data.status); */
             	alert('服务端报错' + data.status);
             	$("#markBtn").val('在地图上标记');
             	$("#markBtn").prop({disabled: false});
         	}
     	});
 	});
	
//上传图片
	new AjaxUpload('#busImgUpload', {
		action: "${base}/agent/file/upload.xhtml",
		name: 'myfile',
		data: {},
		autoSubmit: true,
		responseType: 'json',
		onSubmit: function (filename, ext) {
			//设置允许上传的文件格式
			if (!(ext && /^(jpg|png|gif)$/.test(ext.toLowerCase()))) {
				alert('文件只能为jpg|png|gif格式');
				return false;
			}
			$("#busImgUpload").val("上传中...");
		},
		onComplete: function (filename, data) {
			if (data.status == 0) {
				$("#busImgDiv").show();
				$("#busImg").val(data.data);
				var url = '${aliyunUrl}' + data.data;
				$("#busImgSrc").attr("src", url).fadeIn();
				
				$("#busImgUpload").val("营业执照");
				
				//设置到sessionStorage
				if(window.sessionStorage){
					var s = window.sessionStorage;
					var baiduMerchant = JSON.parse(s.getItem('baidu'));
					baiduMerchant.busImg = data.data;
					s.setItem('baidu', JSON.stringify(baiduMerchant));
				}
			} else {
				alert(data.info);
			}
		}
	});
	
	new AjaxUpload('#shopImgUpload', {
		action: "${base}/agent/file/upload.xhtml",
		name:'myfile',
		data:{},
		autoSubmit:true,
		responseType: 'json',
		onSubmit : function(filename,ext){
			//设置允许上传的文件格式
			if (!(ext && /^(jpg|png|gif)$/.test(ext.toLowerCase()))){
				alert('文件只能为jpg|png|gif格式');
				return false;
			}
			
			var shopImgArr = $("#shopImg").val().split(',');
			if(shopImgArr.length == 6){
                    dangerHint('最多上传六张图片');
                    return false;
			}
			
			$("#shopImgUpload").val("上传中...");
			
		},
		onComplete: function(filename,data) {
			if(data.status == 0){
				var url = '${aliyunUrl}' + data.data;
				var imgT="<img class='mr10' width=\"100\" height=\"100\" src=\""+url+"\" style=\"display: inline-block;\">";
				$("#shopImgDiv").append(imgT);
				
				var shopImg = $("#shopImg").val();
				if(shopImg.length > 0){
					shopImg += ',';
				}
				shopImg += data.data;
				$('#shopImg').val(shopImg);
				                
                $("#shopImgUpload").val("店面实景图");
                
                //设置到sessionStorage
				if(window.sessionStorage){
					var s = window.sessionStorage;
					var baiduMerchant = JSON.parse(s.getItem('baidu'));
					baiduMerchant.shopImg = shopImg;
					s.setItem('baidu', JSON.stringify(baiduMerchant));
				}
			}
		}
	});

	function init(){
		if(window.sessionStorage && window.sessionStorage.getItem('baidu')){
			var s = window.sessionStorage;
			var baiduMerchant = JSON.parse(s.getItem('baidu'));
			
			//load sessionStorage's baiduMerchant
			$('#from').val(baiduMerchant.from);
			if(baiduMerchant.from == 'baidu'){
				$('#uid').val(baiduMerchant.uid);
				$('#shopName').val(baiduMerchant.name);
				$('#shopPhone').val(baiduMerchant.telephone);	
				$('#addressDetail').val(baiduMerchant.address);
				$('#LATITUDE').val(baiduMerchant.location.lat);
				$('#LONGITUDE').val(baiduMerchant.location.lng);
			}else{
				
			}

			//设置上传图片
			if(baiduMerchant.busImg){
				$("#busImg").val(baiduMerchant.busImg);
				
				$("#busImgDiv").show()
				var url = '${aliyunUrl}' + baiduMerchant.busImg;
				$("#busImgSrc").attr("src", url).fadeIn();
			}
			//设置上传图片
			if(baiduMerchant.shopImg){
				$("#shopImg").val(baiduMerchant.shopImg);
				
				var shopImgArr = baiduMerchant.shopImg.split(',');
				
				$("#shopImgDiv").show();
				for(var i = 0; i < shopImgArr.length; i++){
					var url = '${aliyunUrl}' + shopImgArr[i];	
					var shopImg = "<img width=\"100\" height=\"100\" src=\""+url+"\" style=\"display: inline-block;\">";
					$("#shopImgDiv").append(shopImg);
				}
			}
			
			//获取下拉菜单定位信息
			$.ajax({
	         	url: "${base}/agent/map/geo2Location.xhtml",
	         	type: "POST",
	         	data: {
					lat: baiduMerchant.location.lat,
					lng: baiduMerchant.location.lng
	         	},
	         	dataType: "json",
	         	success: function (data) {
					if (data.status == 0) {
						$('#province').val(data.data.province);
						$('#fcity').val(data.data.city);
						$('#farea').val(data.data.district);
						
						$("#province").trigger("change");
						$("#city").trigger("change");
	             	} 

	         	},
	         	error: function (data) {
	             	art.dialog('服务端报错' + data.status);
	         	}
	     	});
		}
		
		//初始化地图
		loadMapScript();
	}

	init();
	
	function backToSearchPage() {
		window.history.go(-1);
	}


function preview() {
	var shopName = $("#shopName").val()
	if (!shopName||shopName=='') {
		//dangerHint('店铺名称不能为空');
		alert("店铺名称不能为空");
		$("#shopName").focus();
		//return false;
		return false;
	}

	var shopPhone = $("#shopPhone").val()
	if (!shopPhone||shopPhone=='') {
		alert('店铺电话不能为空');
		$("#shopPhone").focus();
		return false;
	}

	var area = $("#area").val();
	if (!area || area == '区域') {
		alert('请选择所在区域')
		$("#area").focus();
		return false;
	}
	var addressDetail = $("#addressDetail").val()
	if (!addressDetail) {
		alert('店铺地址不能为空');
		$("#address_detail").focus();
		return false;
	}
	var lng = $("#lng").val();
	var lat = $("#lat").val();
	if (lng==null||lng==''||lat==null||lat=='') {
		alert("请先在百度地图标记");
		return false;
	}
	//valLocation()

	/* var isCheckBizClassify = false;
	$("input[name='bizClassify']:checked").each(function (index, element) {
		isCheckBizClassify = true;
	});

	if(!isCheckBizClassify) {
		alert('请选择行业类别')
		$("input[name='bizClassify']").focus();
		return false;
	} */

	var contactName = $("#contactName").val()
	if (!contactName) {
		alert('联系人不能为空');
		$("#contactName").focus();
		return false;
	}

	var regStr = /(^[1][0-9]{10}$)/;
	var reg = new RegExp(regStr);
	var contactPhone = $("#contactPhone").val();
	if (!reg.test(contactPhone)) {
		alert('手机号格式不正确');
		$("#contactPhone").focus();
		return false;
	}
	/* var busImg = $("#busImg").val();
	if (busImg==null||busImg=='') {
		alert("请先上传营业执照");
		return false;
	} */
	var shopImg = $("#shopImg").val();
	if (shopImg==null||shopImg=='') {
		alert("请先上传门店照片");
		return false;
	}
	//$('#dataForm').submit();
	//var data = $('#dataForm').serialize();
	//var from = $("#from").val()
	//window.location.href ="${absUrl}merchant/preview?"+data;
}
</script>
</body>
</html>